#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <assert.h>
char* my_strncat(char* dest, char* src, size_t num)
{
	assert(dest && src);
	char* ret = dest;
	while (*dest != '\0')
		dest++;
	while (num--)
	{
		*dest = *src;
		if (*dest == '\0')
		{
			return ret;
		}
		dest++;
		src++;
	}
	*dest = '\0';
	return ret;
}


int main()
{
	char arr1[20] = "hello ";
	char arr2[] = "world!";
	//strncat(arr1, arr2, 6);
	char* ret = my_strncat(arr1, arr2, 6);
	printf("%s\n", arr1);
	//printf("%s\n", ret);
	return 0;
}